<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>colorizer Docs</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>colorizer</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Modules</h2>
<ul class="nowrap">
  <li><strong>colorizer</strong></li>
  <li><a href="../modules/colorizer.buffer.html">buffer</a></li>
  <li><a href="../modules/colorizer.color.html">color</a></li>
  <li><a href="../modules/colorizer.matcher.html">matcher</a></li>
  <li><a href="../modules/colorizer.parser.argb_hex.html">parser.argb_hex</a></li>
  <li><a href="../modules/colorizer.parser.hsl.html">parser.hsl</a></li>
  <li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
  <li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
  <li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
  <li><a href="../modules/colorizer.sass.html">sass</a></li>
  <li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
  <li><a href="../modules/colorizer.trie.html">trie</a></li>
  <li><a href="../modules/colorizer.utils.html">utils</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>colorizer</code></h1>
<p>Requires Neovim >= 0.7.0 and <code>set termguicolors</code></p>
<p>Highlights terminal CSI ANSI color codes.</p>
    <h3>See also:</h3>
    <ul>
         <li><a href="../modules/colorizer.html#setup">colorizer.setup</a></li>
         <li><a href="../modules/colorizer.html#attach_to_buffer">colorizer.attach_to_buffer</a></li>
         <li><a href="../modules/colorizer.html#detach_from_buffer">colorizer.detach_from_buffer</a></li>
    </ul>
    <h3>Usage:</h3>
    <ul>
        <pre class="example"> Establish the autocmd to highlight all filetypes.

       `lua require &apos;colorizer&apos;.setup()`

 Highlight using all css highlight modes in every filetype

       `lua require &apos;colorizer&apos;.setup(user_default_options = { css = true; })`

==============================================================================
USE WITH COMMANDS                                          *colorizer-commands*

   *:ColorizerAttachToBuffer*

       Attach to the current buffer and start highlighting with the settings as
       specified in setup (or the defaults).

       If the buffer was already attached(i.e. being highlighted), the
       settings will be reloaded with the ones from setup.
       This is useful for reloading settings for just one buffer.

   *:ColorizerDetachFromBuffer*

       Stop highlighting the current buffer (detach).

   *:ColorizerReloadAllBuffers*

       Reload all buffers that are being highlighted currently.
       Shortcut for ColorizerAttachToBuffer on every buffer.

   *:ColorizerToggle*
       Toggle highlighting of the current buffer.

USE WITH LUA

       All options that can be passed to user_default_options in `setup`
       can be passed here. Can be empty too.
       `0` is the buffer number here

       Attach to current buffer &lt;pre&gt;
           require(&quot;colorizer&quot;).attach_to_buffer(0, {
             mode = &quot;background&quot;,
             css = false,
           })
&lt;/pre&gt;
       Detach from buffer &lt;pre&gt;
           require(&quot;colorizer&quot;).detach_from_buffer(0, {
             mode = &quot;background&quot;,
             css = false,
           })
&lt;/pre&gt;
</pre>
    </ul>
    <h3>Info:</h3>
    <ul>
        <li><strong>Author</strong>: Ashkan Kiani <a href="&#x6d;&#97;&#x69;&#108;&#x74;&#111;&#x3a;f&#114;&#x6f;&#109;&#x2d;&#110;&#x76;&#105;&#x6d;-&#99;&#x6f;&#108;&#x6f;&#114;&#x69;&#122;&#x65;&#114;&#x2e;l&#117;&#x61;&#64;&#x6b;&#105;&#x61;&#110;&#x69;.&#105;&#x6f;">&#x66;&#114;&#x6f;&#109;&#x2d;&#110;&#x76;i&#109;&#x2d;&#99;&#x6f;&#108;&#x6f;&#114;&#x69;z&#101;&#x72;&#46;&#x6c;&#117;&#x61;&#64;&#x6b;&#105;&#x61;n&#105;&#x2e;&#105;&#x6f;</a></li>
    </ul>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#highlight_buffer">highlight_buffer ()</a></td>
	<td class="summary">Highlight the buffer region</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#is_buffer_attached">is_buffer_attached (buf)</a></td>
	<td class="summary">Check if attached to a buffer.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#detach_from_buffer">detach_from_buffer (buf, ns)</a></td>
	<td class="summary">Stop highlighting the current buffer.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#attach_to_buffer">attach_to_buffer (buf, options, typ)</a></td>
	<td class="summary">Attach to a buffer and continuously highlight changes.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#setup">setup (config)</a></td>
	<td class="summary">Easy to use function if you want the full setup without fine grained control.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#get_buffer_options">get_buffer_options (buf)</a></td>
	<td class="summary">Return the currently active buffer options.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#reload_all_buffers">reload_all_buffers ()</a></td>
	<td class="summary">Reload all of the currently active highlighted buffers.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#clear_highlight_cache">clear_highlight_cache ()</a></td>
	<td class="summary">Clear the highlight cache and reload all buffers.</td>
	</tr>
</table>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#user_default_options">user_default_options</a></td>
	<td class="summary">defaults options.</td>
	</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#DEFAULT_NAMESPACE">DEFAULT_NAMESPACE</a></td>
	<td class="summary">Default namespace used in <a href="../modules/colorizer.buffer.html#highlight">colorizer.buffer.highlight</a> and <a href="../modules/colorizer.html#attach_to_buffer">attach_to_buffer</a>.</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "highlight_buffer"></a>
    <strong>highlight_buffer ()</strong>
    </dt>
    <dd>
    Highlight the buffer region





    <h3>See also:</h3>
    <ul>
         <a href="../modules/colorizer.buffer.html#highlight">colorizer.buffer.highlight</a>
    </ul>


</dd>
    <dt>
    <a name = "is_buffer_attached"></a>
    <strong>is_buffer_attached (buf)</strong>
    </dt>
    <dd>
    Check if attached to a buffer.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">buf</span>
         number|nil: A value of 0 implies the current buffer.
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        number|nil: if attached to the buffer, false otherwise.
    </ol>


    <h3>See also:</h3>
    <ul>
         <a href="../modules/colorizer.buffer.html#highlight">colorizer.buffer.highlight</a>
    </ul>


</dd>
    <dt>
    <a name = "detach_from_buffer"></a>
    <strong>detach_from_buffer (buf, ns)</strong>
    </dt>
    <dd>
    Stop highlighting the current buffer.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">buf</span>
         number|nil: buf A value of 0 or nil implies the current buffer.
        </li>
        <li><span class="parameter">ns</span>
         number|nil: ns the namespace id, if not given DEFAULT_NAMESPACE is used
        </li>
    </ul>





</dd>
    <dt>
    <a name = "attach_to_buffer"></a>
    <strong>attach_to_buffer (buf, options, typ)</strong>
    </dt>
    <dd>
    Attach to a buffer and continuously highlight changes.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">buf</span>
         integer: A value of 0 implies the current buffer.
        </li>
        <li><span class="parameter">options</span>
         table|nil: Configuration options as described in <a href="../modules/colorizer.html#setup">setup</a>
        </li>
        <li><span class="parameter">typ</span>
         string|nil: "buf" or "file" - The type of buffer option
        </li>
    </ul>





</dd>
    <dt>
    <a name = "setup"></a>
    <strong>setup (config)</strong>
    </dt>
    <dd>
    Easy to use function if you want the full setup without fine grained control.
Setup an autocmd which enables colorizing for the filetypes and options specified.</p>

<p>By default highlights all FileTypes.</p>

<p>Example config:~</p>

<pre>
  { filetypes = { "css", "html" }, user_default_options = { names = true } }
</pre>

<p>Setup with all the default options:~</p>

<pre>
    require("colorizer").setup {
      filetypes = { "*" },
      user_default_options,
      -- all the sub-options of filetypes apply to buftypes
      buftypes = {},
    }
</pre>

<p>For all user<em>default</em>options, see |user<em>default</em>options|


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">config</span>
         table: Config containing above parameters.
        </li>
    </ul>




    <h3>Usage:</h3>
    <ul>
        <pre class="example"><span class="backtick"><code>require&apos;colorizer&apos;.setup()</code></span></pre>
    </ul>

</dd>
    <dt>
    <a name = "get_buffer_options"></a>
    <strong>get_buffer_options (buf)</strong>
    </dt>
    <dd>
    Return the currently active buffer options.


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">buf</span>
         number|nil: Buffer number
        </li>
    </ul>

    <h3>Returns:</h3>
    <ol>

        table|nil
    </ol>




</dd>
    <dt>
    <a name = "reload_all_buffers"></a>
    <strong>reload_all_buffers ()</strong>
    </dt>
    <dd>
    Reload all of the currently active highlighted buffers.







</dd>
    <dt>
    <a name = "clear_highlight_cache"></a>
    <strong>clear_highlight_cache ()</strong>
    </dt>
    <dd>
    Clear the highlight cache and reload all buffers.







</dd>
</dl>
    <h2 class="section-header "><a name="Tables"></a>Tables</h2>

    <dl class="function">
    <dt>
    <a name = "user_default_options"></a>
    <strong>user_default_options</strong>
    </dt>
    <dd>

<p>defaults options.
In <a href="../modules/colorizer.html#user_default_options">user_default_options</a>, there are 2 types of options</p>

<ol>
    <li><p>Individual options - <code>names</code>, <code>RGB</code>, <code>RRGGBB</code>, <code>RRGGBBAA</code>, <code>hsl_fn</code>, <code>rgb_fn</code> , <code>RRGGBBAA</code>, <code>AARRGGBB</code>, <code>tailwind</code>, <code>sass</code></p></li>
    <li><p>Alias options - <code>css</code>, <code>css_fn</code></p></li>
</ol>

<p>If <code>css_fn</code> is true, then <code>hsl_fn</code>, <code>rgb_fn</code> becomes <code>true</code></p>

<p>If <code>css</code> is true, then <code>names</code>, <code>RGB</code>, <code>RRGGBB</code>, <code>RRGGBBAA</code>, <code>hsl_fn</code>, <code>rgb_fn</code> becomes <code>true</code></p>

<p>These options have a priority, Individual options have the highest priority, then alias options</p>

<p>For alias, <code>css_fn</code> has more priority over <code>css</code></p>

<p>e.g: Here <code>RGB</code>, <code>RRGGBB</code>, <code>RRGGBBAA</code>, <code>hsl_fn</code>, <code>rgb_fn</code> is enabled but not <code>names</code></p>


<pre>
  require 'colorizer'.setup { user_default_options = { names = false, css = true } }
</pre>


<p>e.g: Here <code>names</code>, <code>RGB</code>, <code>RRGGBB</code>, <code>RRGGBBAA</code> is enabled but not <code>rgb_fn</code> and <code>hsl_fn</code></p>


<pre>
  require 'colorizer'.setup { user_default_options = { css_fn = false, css = true } }
</pre>



<pre>
  user_default_options = {
      RGB = true, -- #RGB hex codes
      RRGGBB = true, -- #RRGGBB hex codes
      names = true, -- "Name" codes like Blue or blue
      RRGGBBAA = false, -- #RRGGBBAA hex codes
      AARRGGBB = false, -- 0xAARRGGBB hex codes
      rgb_fn = false, -- CSS rgb() and rgba() functions
      hsl_fn = false, -- CSS hsl() and hsla() functions
      css = false, -- Enable all CSS features: rgb_fn, hsl_fn, names, RGB, RRGGBB
      css_fn = false, -- Enable all CSS *functions*: rgb_fn, hsl_fn
      -- Available modes for <code>mode</code>: foreground, background,  virtualtext
      mode = "background", -- Set the display mode.
      -- Available methods are false / true / "normal" / "lsp" / "both"
      -- True is same as normal
      tailwind = false, -- Enable tailwind colors
      -- parsers can contain values used in |user_default_options|
      sass = { enable = false, parsers = { css }, }, -- Enable sass colors
      virtualtext = "■",
      -- update color values even if buffer is not focused
      always_update = false
  }
</pre>




    <h3>Fields:</h3>
    <ul>
        <li><span class="parameter">RGB</span>
         boolean
        </li>
        <li><span class="parameter">RRGGBB</span>
         boolean
        </li>
        <li><span class="parameter">names</span>
         boolean
        </li>
        <li><span class="parameter">RRGGBBAA</span>
         boolean
        </li>
        <li><span class="parameter">AARRGGBB</span>
         boolean
        </li>
        <li><span class="parameter">rgb_fn</span>
         boolean
        </li>
        <li><span class="parameter">hsl_fn</span>
         boolean
        </li>
        <li><span class="parameter">css</span>
         boolean
        </li>
        <li><span class="parameter">css_fn</span>
         boolean
        </li>
        <li><span class="parameter">mode</span>
         string
        </li>
        <li><span class="parameter">tailwind</span>
         boolean|string
        </li>
        <li><span class="parameter">sass</span>
         table
        </li>
        <li><span class="parameter">virtualtext</span>
         string
        </li>
        <li><span class="parameter">always_update</span>
         boolean
        </li>
    </ul>





</dd>
</dl>
    <h2 class="section-header "><a name="Fields"></a>Fields</h2>

    <dl class="function">
    <dt>
    <a name = "DEFAULT_NAMESPACE"></a>
    <strong>DEFAULT_NAMESPACE</strong>
    </dt>
    <dd>
    Default namespace used in <a href="../modules/colorizer.buffer.html#highlight">colorizer.buffer.highlight</a> and <a href="../modules/colorizer.html#attach_to_buffer">attach_to_buffer</a>.





    <h3>See also:</h3>
    <ul>
         <li><a href="../modules/colorizer.buffer.html#highlight">colorizer.buffer.highlight</a></li>
         <li><a href="../modules/colorizer.html#attach_to_buffer">attach_to_buffer</a></li>
    </ul>


</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated - February </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
